function addRowToTable()
{
  var tbl = document.getElementById('Calories');
  var lastRow = tbl.rows.length;
  // if there's no header row in the table, then iteration = lastRow + 1
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  
  // left cell
  var cellLeft = row.insertCell(0);
  var textNode = document.createTextNode('Item Name:');
  cellLeft.appendChild(textNode);
  
  // right cell
  var cellRight = row.insertCell(1);
  var el = document.createElement('input');
  el.type = 'text';
  el.name = 'item_name' + iteration;
  el.id = 'item_name' + iteration;
  el.size = 20;
  cellRight.appendChild(el);

  //second left cell
  var cellSecondLeft = row.insertCell(2);
  var textNode = document.createTextNode('Calories:');
  cellSecondLeft.appendChild(textNode);

  //second right cell
  var cellSecondRight = row.insertCell(3);
  var ell = document.createElement('input');
  ell.type = 'text';
  ell.name = 'calories' + iteration;
  ell.id = 'calories' + iteration;
  ell.size = 20;
  cellSecondRight.appendChild(ell);

  //Post table length to hidden input
  document.getElementById("endofrow").value = tbl.rows.length - 1;

  document.getElementById(el.id).focus();

}

function UnhideTable()
{
document.getElementById("CalorieTable").style.display = "inline";
document.getElementById("initdatebtn").style.display = "none";
document.getElementById("item_name0").focus()
}